package sort.test242;

/**
 * @author code_yc
 * @version 1.0
 * @date 2020/7/19 11:25
 */
public class Solution1 {

    public boolean isAnagram(String s, String t) {
        if ("".equals(s)) return "".equals("");
        if (s.length() != t.length()) return false;
        int[] temp = new int[26];
        for (int i = 0; i < s.length(); i++) {
            temp[s.charAt(i) - 'a']++;
            temp[t.charAt(i) - 'a']--;
        }
        for (int n : temp) {
            if (n != 0) return false;
        }
        return true;
    }
}
